home *** CD-ROM | disk | FTP | other *** search
- property iCurrentChapter, iCurrentParagraph, iVisitedMarkList, iMaxChapter, iMaxParagraphList, objMisc, iPreferenceFileName, iPreferenceFolder, iAllMarkList, iPreferenceExist, iUserName, iSavePreference
- global objfileio, galllessonlist, gBookmarkLoc, gGraphicPath, gDelimiter, onIBM
-
- on birth me
- set iCurrentChapter to 0
- set iCurrentParagraph to 0
- set iVisitedMarkList to []
- set iMaxChapter to count(galllessonlist)
- set iMaxParagraphList to []
- repeat with tChapter = 1 to iMaxChapter
- add(iMaxParagraphList, getAt(getAt(galllessonlist, tChapter), 2))
- end repeat
- set objMisc to birth(script "Misc_script")
- set iPreferenceFileName to EMPTY
- mGetPreferenceFile(me)
- return me
- end
-
- on mGetMaxChapter me
- return iMaxChapter
- end
-
- on mGetMaxParagraph me, tChapter
- return getAt(iMaxParagraphList, tChapter)
- end
-
- on mGetStatus me, tChapter, tParagraph
- set tVisited to getAt(getAt(iVisitedMarkList, tChapter), tParagraph)
- if tVisited then
- return #VISITED
- else
- return #NORMAL
- end if
- end
-
- on mGetPreferenceFile me
- mNewUser(me)
- end
-
- on mNewUser me
- set iVisitedMarkList to []
- repeat with tChapter = 1 to iMaxChapter
- set tMaxParagraph to getAt(iMaxParagraphList, tChapter)
- set tVisitedmarkList to []
- if tMaxParagraph <> 0 then
- setAt(tVisitedmarkList, tMaxParagraph, 0)
- end if
- add(iVisitedMarkList, tVisitedmarkList)
- end repeat
- end
-
- on mSetVisited me, tChapter, tParagraph
- setAt(getAt(iVisitedMarkList, tChapter), tParagraph, 1)
- end
-
- on mSetBookMark me, tChapter, tParagraph
- set tNewBookmarkStatus to not getAt(getAt(iBookMarkList, tChapter), tParagraph)
- set tVisitedmarkStatus to getAt(getAt(iVisitedMarkList, tChapter), tParagraph)
- setAt(getAt(iBookMarkList, tChapter), tParagraph, tNewBookmarkStatus)
- return list(tNewBookmarkStatus, tVisitedmarkStatus)
- end
-